<!--_meta 作为公共模版分离出去-->
<!DOCTYPE HTML>
<html>
<head>
<${a!}#include "head.html">
<title>添加</title>
</head>
<body>
<article class="page-container">
	<form action="$${a!}{contextPath}<#if package.ModuleName??>/${package.ModuleName}</#if>/<#if controllerMappingHyphenStyle??>${controllerMappingHyphen}<#else>${table.entityPath}</#if>/save.do" method="post" class="form form-horizontal" id="form">
		<#list table.fields as field>
		<#if field.propertyName!='id'>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3">${field.comment}：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" required value="$${a!}{entity.${field.propertyName}}" name="${field.propertyName}">
			</div>
		</div>
		</#if>
		</#list>
		<div class="row cl">
			<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
				<input class="btn btn-primary radius" type="submit" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
			</div>
		</div>
		<input type="hidden" value="$${a!}{entity.id}" name="id">
	</form>
</article>

<${a!}#include "footer.html">

<!--请在下方写此页面业务相关的脚本--> 
<script type="text/javascript">
$(function(){
    $('.skin-minimal input').iCheck({
        checkboxClass: 'icheckbox-blue',
        radioClass: 'iradio-blue',
        increaseArea: '20%'
    })

	$("#form").validate({
		rules:{
		},
		onkeyup:false,
		focusCleanup:true,
		success:"valid",
		submitHandler:function(form){
			var options = {  
					url:$("#form").attr("action"),
	                success: function() {
	                	layer.alert('操作成功', function(index){
	  	                	var index = parent.layer.getFrameIndex(window.name);
	  	        			parent.$("[name='refresh']").click();
	  	        			parent.layer.close(index);
	                	});    
	                	
	                }   
	        }; 
			$(form).ajaxSubmit(options);
		}
	});
});
</script> 
<!--/请在上方写此页面业务相关的脚本-->
</body>
</html>